inspector: Avoid a NULL deref
authorMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 22:42:24 +0000 (18:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 22:42:24 +0000 (18:42 -0400)
gtk/inspector/prop-editor.c

index dd17bd4be6c77b0ebcb05c250f94ccd4a85074c9..32830274543023e3dcc9af118065ca59e9269b0f 100644 (file)
@@ -1177,7 +1177,7 @@ attribute_editor (GObject                *object,
 
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
   gtk_container_add (GTK_CONTAINER (box), gtk_label_new (_("Model:")));
-  text = g_strdup_printf (_("%p (%s)"), model, g_type_name (G_TYPE_FROM_INSTANCE (model)));
+  text = g_strdup_printf (_("%p (%s)"), model, model ? g_type_name (G_TYPE_FROM_INSTANCE (model)) : "null" );
   gtk_container_add (GTK_CONTAINER (box), gtk_label_new (text));
   g_free (text);
   button = gtk_button_new_with_label (_("Properties"));